const path = require('path')

// path.extname()可以获取路径的扩展名部分
const pathStr = '/a/b/c/d/index.html'
const extendName = path.extname(pathStr)

console.log(extendName)